/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.f1x.api.message.fields;

// Generated by org.f1x.tools.DictionaryGenerator from QuickFIX dictionary
public enum RegistRejReasonCode implements org.f1x.api.message.types.IntEnum {
	INVALID_UNACCEPTABLE_ACCOUNT_TYPE(1),
	INVALID_UNACCEPTABLE_TAX_EXEMPT_TYPE(2),
	INVALID_UNACCEPTABLE_OWNERSHIP_TYPE(3),
	INVALID_UNACCEPTABLE_NO_REG_DETLS(4),
	INVALID_UNACCEPTABLE_REG_SEQ_NO(5),
	INVALID_UNACCEPTABLE_REG_DTLS(6),
	INVALID_UNACCEPTABLE_MAILING_DTLS(7),
	INVALID_UNACCEPTABLE_MAILING_INST(8),
	INVALID_UNACCEPTABLE_INVESTOR_ID(9),
	INVALID_UNACCEPTABLE_INVESTOR_ID_SOURCE(10),
	INVALID_UNACCEPTABLE_DATE_OF_BIRTH(11),
	INVALID_UNACCEPTABLE_INVESTOR_COUNTRY_OF_RESIDENCE(12),
	INVALID_UNACCEPTABLE_NODISTRIBINSTNS(13),
	INVALID_UNACCEPTABLE_DISTRIB_PERCENTAGE(14),
	INVALID_UNACCEPTABLE_DISTRIB_PAYMENT_METHOD(15),
	INVALID_UNACCEPTABLE_CASH_DISTRIB_AGENT_ACCT_NAME(16),
	INVALID_UNACCEPTABLE_CASH_DISTRIB_AGENT_CODE(17),
	INVALID_UNACCEPTABLE_CASH_DISTRIB_AGENT_ACCT_NUM(18),
	OTHER(99);

	private final int code;

	RegistRejReasonCode (int code) {
		this.code  = code;
	}

	public int getCode() { return code; }

	public static RegistRejReasonCode parse(String s) {
		switch(s) {
			case "1" : return INVALID_UNACCEPTABLE_ACCOUNT_TYPE;
			case "2" : return INVALID_UNACCEPTABLE_TAX_EXEMPT_TYPE;
			case "3" : return INVALID_UNACCEPTABLE_OWNERSHIP_TYPE;
			case "4" : return INVALID_UNACCEPTABLE_NO_REG_DETLS;
			case "5" : return INVALID_UNACCEPTABLE_REG_SEQ_NO;
			case "6" : return INVALID_UNACCEPTABLE_REG_DTLS;
			case "7" : return INVALID_UNACCEPTABLE_MAILING_DTLS;
			case "8" : return INVALID_UNACCEPTABLE_MAILING_INST;
			case "9" : return INVALID_UNACCEPTABLE_INVESTOR_ID;
			case "10" : return INVALID_UNACCEPTABLE_INVESTOR_ID_SOURCE;
			case "11" : return INVALID_UNACCEPTABLE_DATE_OF_BIRTH;
			case "12" : return INVALID_UNACCEPTABLE_INVESTOR_COUNTRY_OF_RESIDENCE;
			case "13" : return INVALID_UNACCEPTABLE_NODISTRIBINSTNS;
			case "14" : return INVALID_UNACCEPTABLE_DISTRIB_PERCENTAGE;
			case "15" : return INVALID_UNACCEPTABLE_DISTRIB_PAYMENT_METHOD;
			case "16" : return INVALID_UNACCEPTABLE_CASH_DISTRIB_AGENT_ACCT_NAME;
			case "17" : return INVALID_UNACCEPTABLE_CASH_DISTRIB_AGENT_CODE;
			case "18" : return INVALID_UNACCEPTABLE_CASH_DISTRIB_AGENT_ACCT_NUM;
			case "99" : return OTHER;
		}
		return null;
	}

}